<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
<title>admin</title>
<link href="{SITE_URL}dayrui/statics/css/index.css" rel="stylesheet" type="text/css" />
<link href="{SITE_URL}dayrui/statics/css/table_form.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="{SITE_PATH}dayrui/statics/css/font-awesome/css/font-awesome.css" />
<script type="text/javascript">var siteurl = "{SITE_PATH}{SELF}";var memberpath = "{MEMBER_PATH}";</script>
<script type="text/javascript" src="{SITE_PATH}member/statics/js/{SITE_LANGUAGE}.js"></script>
<script type="text/javascript" src="{SITE_PATH}member/statics/js/jquery.min.js"></script>
<script type="text/javascript" src="{SITE_PATH}member/statics/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="{SITE_PATH}member/statics/js/jquery.cookie.js"></script>
<script type="text/javascript" src="{SITE_PATH}member/statics/js/jquery.artDialog.js?skin=default"></script> 
<script type="text/javascript" src="{SITE_PATH}member/statics/js/validate.js"></script>
<script type="text/javascript" src="{SITE_PATH}member/statics/js/admin.js"></script>
<script type="text/javascript" src="{SITE_PATH}member/statics/js/dayrui.js"></script>
<script type="text/javascript">
var dr_login = 1;
$(function() {
	$(".table-list tr").last().addClass("dr_border_none");
	$(".subnav .content-menu span").last().remove();
	art.dialog.close();
	$("input[name='dr_select']").click(function(){
		$(".dr_select").attr("checked",$(this).attr("checked"));
	});
	// 排序操作
	$('.table-list thead th').click(function(e) {
		var _class = $(this).attr("class");
		if (_class == undefined) return;
		var _name = $(this).attr("name");
		var _order = '';
		if (_class == "sorting") {
			_order = 'desc';
		} else if (_class == "sorting_desc") {
			_order = 'asc';
		} else {
			_order = 'desc';
		}
		{php if (isset($param['search']) && $param['search']) $get['search'] = 1;}
		var url = "{dr_url(1, $get)}&order="+_name+" "+_order;
		location.href=url;
	});
	// 适应浏览器分辨率
	var width = $(window).width();
	$('.table-list td, .table-list th').each(function(e){
		if (width < 1000 && $(this).attr('hide')) {
			$(this).hide();
		}
	});
    var h = 0;
    $(".dr_row_hide").each(function(){
        var hh = $(this).height();
        if (h > 0 && hh != h) {
            $('.table-list td, .table-list th').each(function(e){
                if ($(this).attr('hide')) {
                    $(this).hide();
                }
            });
        } else {
            h = hh;
        }
    });
    // 关闭加载窗口
	top.$('.page-loading').remove();
	$('.onloading, #pages a, .sorting, .sorting_desc, .sorting_asc, :submit').click(function(){
		top.dr_loading();
	});
    $('.sp-choose, .noloading').click(function(){
        top.$('.page-loading').remove();
    });
    // 登录检测
    setInterval('dr_test_login()', 5000);
});
function dr_test_login() {
    $.get('{dr_url("api/login")}', function(html){
        if (html.length <= 10) {
            dr_login = 1;
        } else {
            if (dr_login == 1) {
                dr_login = 0;
                var throughBox = art.dialog.through;
                var win = $.dialog.top;
                throughBox({
                    content: html,
                    title: '{lang("html-469")}',
                    cancel: function() {
                        dr_login = 1;
                    },
                    ok: function() {
                        // 标示可以提交表单
                        win.$("#mark").val("0");
                        // 按钮返回验证表单函数
                        if (win.dr_form_check()) {
                            var _data = win.$("#myform").serialize();
                            // 将表单数据ajax提交验证
                            $.ajax({type: "POST",dataType:"json", url: '{dr_url("login/ajax")}' , data: _data,
                                success: function(data) {
                                    //验证成功
                                    if (data.status == 1) {
                                        $.dialog.tips('{lang("m-002")}', 2, 1);
                                    } else {
                                        //验证失败
                                        $.dialog.tips(data.code);
                                    }
                                },
                                error: function(HttpRequest, ajaxOptions, thrownError) {
                                    dr_alert(HttpRequest.responseText);
                                }
                            });
                        }
                        dr_login = 1;
                    }
                });
            }
        }
    });
}
</script>
</head>
<body>